<?php
function utracker()
{
	$version = "utracker 0.1";
	$LOGFILE = "utracker.log";
	$ts = date("r");	
	$ip = $_SERVER["REMOTE_ADDR"];
	$port = $_SERVER["REMOTE_PORT"];
	$browser = $_SERVER["HTTP_USER_AGENT"];
	$url = $_SERVER["SCRIPT_URI"];
	$query = $_SERVER["QUERY_STRING"];
	$method = $_SERVER["REQUEST_METHOD"];
	$f = fopen($LOGFILE, "a");
	if (flock($f, LOCK_EX)) {
		fwrite($f, "ts:$ts|ip:$ip|p:$port|b:$browser|m:$method $url|$query\n");
		flock($f, LOCK_UN);
	}
	fclose($f);
}

utracker();
?>
